package org.gwu.seuss.service;

import java.io.IOException;
import java.security.GeneralSecurityException;

import org.gwu.seuss.communication.exception.AuthenticationException;
import org.gwu.seuss.communication.exception.AuthorizationException;
import org.gwu.seuss.communication.exception.FileException;
import org.gwu.seuss.communication.exception.UserException;
import org.gwu.seuss.communication.request.ClientRequest;
import org.gwu.seuss.domain.User;

public interface UserService {

	public void login(String username, String password)
			throws AuthenticationException;

	public void authorizeAdmin(String username) throws AuthorizationException;

	public void authorizeUser(ClientRequest req) throws AuthorizationException,
			UserException, FileException;

	public User selectUserByEmail(String email);

	public int updateUsersSessionKey(byte[] sessionKey, String email);

	public int updateUserEmail(String oldEmail, String newEmail);

	public int createUser(String username, String password)
			throws GeneralSecurityException, IOException;

	public int disableUser(String username);

	public int enableUser(String username);

	public int removeUser(String username);

	int resetPassword(String username, String newPassword, String oldPassword)
			throws AuthenticationException, GeneralSecurityException,
			IOException;
}